package org.jivesoftware.smackx.packet;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import org.jivesoftware.smack.packet.PacketExtension;

public class HeadersExtension
  implements PacketExtension
{
  public static final String NAMESPACE = "http://jabber.org/protocol/shim";
  private Collection<Header> headers = Collections.EMPTY_LIST;

  public HeadersExtension(Collection<Header> paramCollection)
  {
    if (paramCollection != null)
      this.headers = paramCollection;
  }

  public Collection<Header> getHeaders()
  {
    return this.headers;
  }

  public String getElementName()
  {
    return "headers";
  }

  public String getNamespace()
  {
    return "http://jabber.org/protocol/shim";
  }

  public String toXML()
  {
    StringBuilder localStringBuilder = new StringBuilder("<" + getElementName() + " xmlns='" + getNamespace() + "'>");
    Iterator localIterator = this.headers.iterator();
    while (localIterator.hasNext())
    {
      Header localHeader = (Header)localIterator.next();
      localStringBuilder.append(localHeader.toXML());
    }
    localStringBuilder.append("</" + getElementName() + '>');
    return localStringBuilder.toString();
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smackx.packet.HeadersExtension
 * JD-Core Version:    0.6.1
 */